# Maintainer: ImperatorS79 <fevrier.simon@gmail.com>

_realname=stb
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=r2129.8b5f1f3
pkgrel=1
_commit='8b5f1f37b5b75829fc72d38e7b5d4bcbf8a26d55'
pkgdesc="single-file public domain (or MIT licensed) libraries for C/C++"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="https://github.com/nothings/stb"
license=('spdx:Unlicense' 'spdx:MIT')
makedepends=('git')
source=("git+https://github.com/nothings/${_realname}#commit=${_commit}")
sha256sums=('SKIP')

pkgver() {
  cd stb
  printf "r%s.%s" "$(git rev-list --count $_commit)" "$(git rev-parse --short $_commit)"
}

package() {
  install -Dm 644 stb/*.{c,h} -t "${pkgdir}${MINGW_PREFIX}"/include/stb/
  install -Dm 644 stb/LICENSE -t "${pkgdir}${MINGW_PREFIX}"/share/licenses/stb/
}
